package smoker2;

import static smoker.Material.*;

class SmokerMain {
	
	@SuppressWarnings("static-access")
	public static void main(String[] a) throws InterruptedException{
            Tisch t = new Tisch();
            Agent agent = new Agent(t);

            Smoker paper = new Smoker(agent, PAPER, t);
            Smoker tobacco = new Smoker(agent, TOBACCO, t);
            Smoker matches = new Smoker(agent, MATCHES, t);

            agent.start();
            paper.start();
            tobacco.start();
            matches.start();

            Thread.currentThread().sleep(10000);

            agent.interrupt();
            paper.interrupt();
            tobacco.interrupt();
            matches.interrupt();

            agent.join();
            paper.join();
            tobacco.join();
            matches.join();

            System.out.println("Ende");
	}
    
}
